package top.yaofengqiao.springcloudsimple.system.biz.domain.log.serivce;

import org.springframework.stereotype.Service;
import top.yaofengqiao.springcloudsimple.system.biz.domain.log.repository.IOperatorLogRepository;
import top.yaofengqiao.springcloudsimple.web.starter.service.ISysLogService;
import top.yaofengqiao.springcloudsimple.web.starter.util.OperatorLog;

import javax.annotation.Resource;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author yfq
 * @date 16:28
 * @description
 */
@Service
public class SysLogService implements ISysLogService {
    @Resource
    private ThreadPoolExecutor operatorLogThreadPoolExecutor;
    @Resource
    private IOperatorLogRepository operatorLogRepository;

    @Override
    public void saveSysLog(OperatorLog operatorLog) {
        operatorLogThreadPoolExecutor.submit(() -> operatorLogRepository.save(operatorLog));
    }

}
